package com.deepwiki.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * Wiki配置类
 */
@Configuration
@ConfigurationProperties(prefix = "wiki")
public class WikiConfig {

    /**
     * 输出目录
     */
    private String outputDirectory = "./wiki-output";

    /**
     * 仓库克隆目录
     */
    private String repositoryCloneDirectory = "./repositories";

    /**
     * 提示词模板目录
     */
    private String promptTemplatesDirectory = "src/main/resources/prompts";

    /**
     * 存储配置
     */
    private Storage storage = new Storage();

    /**
     * 存储配置类 - 统一使用Elasticsearch
     */
    public static class Storage {
        /**
         * 存储类型：只支持elasticsearch
         */
        private String type = "elasticsearch";

        /**
         * Elasticsearch存储配置
         */
        private Elasticsearch elasticsearch = new Elasticsearch();



        public static class Elasticsearch {
            private String hosts = "localhost:9200";
            private String username;
            private String password;
            private String indexPrefix = "wiki";

            public String getHosts() {
                return hosts;
            }

            public void setHosts(String hosts) {
                this.hosts = hosts;
            }

            public String getUsername() {
                return username;
            }

            public void setUsername(String username) {
                this.username = username;
            }

            public String getPassword() {
                return password;
            }

            public void setPassword(String password) {
                this.password = password;
            }

            public String getIndexPrefix() {
                return indexPrefix;
            }

            public void setIndexPrefix(String indexPrefix) {
                this.indexPrefix = indexPrefix;
            }
        }

        // Getters and Setters
        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public Elasticsearch getElasticsearch() {
            return elasticsearch;
        }

        public void setElasticsearch(Elasticsearch elasticsearch) {
            this.elasticsearch = elasticsearch;
        }
    }

    // Getters and Setters
    public String getOutputDirectory() {
        return outputDirectory;
    }

    public void setOutputDirectory(String outputDirectory) {
        this.outputDirectory = outputDirectory;
    }

    public String getRepositoryCloneDirectory() {
        return repositoryCloneDirectory;
    }

    public void setRepositoryCloneDirectory(String repositoryCloneDirectory) {
        this.repositoryCloneDirectory = repositoryCloneDirectory;
    }

    public String getPromptTemplatesDirectory() {
        return promptTemplatesDirectory;
    }

    public void setPromptTemplatesDirectory(String promptTemplatesDirectory) {
        this.promptTemplatesDirectory = promptTemplatesDirectory;
    }

    public Storage getStorage() {
        return storage;
    }

    public void setStorage(Storage storage) {
        this.storage = storage;
    }
} 